package com.haircut.project.controller.record;

import com.haircut.project.service.record.IRecordService;
import com.haircut.project.vo.record.RecordReqVo;
import com.haircut.project.vo.record.RecordResVo;
import com.modular.result.PageResult;
import com.modular.result.RspMessage;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/b/project/record")
public class RecordController {
    @Autowired
    private IRecordService recordService;
    /**
     * 查询分类列表
     * @return
     */
    @ApiOperation(value = "查询分类信息")
    @PostMapping("findPage")
    public RspMessage<PageResult<RecordResVo>> findPage(@RequestBody RecordReqVo reqVo){
        return RspMessage.success(recordService.findManagerPage(reqVo));
    }
    /**
     * 查询分类列表
     * @return
     */
    @ApiOperation(value = "查询分类信息")
    @PostMapping("export")
    public void export(@RequestBody RecordReqVo reqVo, HttpServletResponse res){
        recordService.export(reqVo,res);
    }

    /**
     * 查询分类列表
     * @return
     */
    @ApiOperation(value = "核查数据")
    @GetMapping("checkRecord")
    public RspMessage<Void> checkRecord(@ApiParam("记录id") @RequestParam("recordId") String recordId){
        recordService.checkRecord(recordId);
        return RspMessage.success();
    }



}
